package pageObject;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import utils.ReportWriter;

public class HomePage extends BasePage {
    protected static final String homeURL = "http://rozetka.com.ua/";
    protected static final By logoutLinkName = By.name("signout");

    public HomePage(WebDriver driver) {
        super(driver);
    }

    public static HomePage openSite(WebDriver driver) {
        ReportWriter.info("Downloading " + homeURL + "...");
        driver.get(homeURL);
        return new HomePage(driver);
    }

    public HomePage logout() {
        driver.findElement(logoutLinkName).click();
        return new HomePage(driver);
    }
}
